package thinkingJava.chapter15;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

public class GenericVarages {
	public static <T> List<T> makeList(T... args) {
		List<T> result = new ArrayList<T>();
		for (T t : args) {
			result.add(t);
		}
		return result;
	}
	public static void main(String[] args) {
		List<String> ls = makeList("A");
		System.out.println(ls);
		ls = makeList("A","B","C");
		System.out.println(ls);
		ls = makeList(Pattern.compile("\\s*").split("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
		System.out.println(ls);
	}
}
